/**
 * Copyright (C) 2013 SHANGHAI VOLKSWAGEN, All rights reserved.
 * License version 1.0, a copy of which has been included with this.
 *
 * @File name：com.bwie.system.api.factory.SystemRemoteServiceFallback
 * @Create on：2024/3/22
 * @Author：liuchang
 */
package com.bwie.system.api.factory;

import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.system.api.SystemRemoteService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * <p>ClassName：SystemRemoteServiceFallback</p >
 * <p>Description：</p >
 * <p>Author：liuchang</p >
 * <p>Date：2024/3/22</p >
 */
@Component
public class SystemRemoteServiceFallback implements FallbackFactory<SystemRemoteService> {
    @Override
    public SystemRemoteService create(Throwable cause) {
        return new SystemRemoteService() {
            @Override
            public Result<User> findByPhone(String phone) {
                return Result.error("系统繁忙。。。。");
            }
        };
    }
}
